@extends('layouts.app')

@section('title','AnswerList')

@section('content')
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <header class="list-header">
                    <section>大师回答列表</section>
                </header>

                        <table class="table table-hover table-striped list-table">
                            <tr class="list-table-tr">
                                <th>回答内容</th>
                                <th>大师名称</th>
                                <th>问题</th>
                                <th>回答时间</th>
                                <th class="text-right">Operation</th>
                            </tr>

                            @foreach($answers as $v)
                                <tr>
                                    <td>{{ $v->answer_content }}</td>
                                    <td> {{ $v->master_name }}</td>
                                    <td>{{ $v->question->question_content }}</td>
                                    <td>{{ $v->created_at }}</td>
                                    <td class="text-right">
                                        <form action="{{ URL('admin/answers/'.$v->id) }}" method="POST" style="display: inline;">
                                            <input name="_method" type="hidden" value="DELETE">
                                            <input type="hidden" name="_token" value="{{ csrf_token() }}">
                                            <button type="submit" class="delete"><i class="fa fa-trash-o fa-lg" aria-hidden="true"></i></button>
                                        </form>
                                    </td>

                                </tr>
                            @endforeach
                        </table>
                        <hr>
                        {!! $answers->render() !!}
                    </div>
                </div>
            </div>
        </div>
    </div>

@endsection